"""
This module defines all urls for the SampleTracker website
"""

from django.conf.urls.defaults import patterns
from django.conf.urls.defaults import include
from django.conf.urls.defaults import url
from django.views.generic import list_detail
from django.contrib import admin
from SampleTracker.sample_tracker.models import Sample

admin.autodiscover()

sample_info = {"queryset" : Sample.objects.all().order_by("-name"),}

urlpatterns = patterns('',
    url(r'^add_sample/', 'SampleTracker.sample_tracker.views.add_sample'),
    url(r'^sample_detail/(?P<sample_id>\d+)/$', 
        'SampleTracker.sample_tracker.views.show_sample_details'),
    url(r'^sample_list/$', list_detail.object_list,  sample_info),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^accounts/', include('registration.urls')),
    url(r'^$', 'SampleTracker.sample_tracker.views.home', name='home'), )
    